package 终极案例;

import java.util.Scanner;

public class testo2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int [] arr = new int [6];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入成绩");
            int a = sc.nextInt();
            arr[i] = a;
        }
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            if(i==arr.length-1){
                System.out.print(arr[i]);
            }else{
                System.out.print(arr[i]+",");
            }
        }
        System.out.println("]");
        int sum =0;
        for (int i = 0; i < arr.length; i++) {
            sum +=arr[i];
        }
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(min>arr[i]){
                min = arr[i];
            }
        }
        double avg = 1.0F*(sum-min)/(arr.length-1);
        System.out.println("平均成绩为："+avg);

    }
}
